package com.woniuxy.ptapp.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.commons.util.BeanCopyUtil;
import com.woniuxy.ptapp.common.exception.EnumExceptionCode;
import com.woniuxy.ptapp.common.exception.WoniuxyException;
import com.woniuxy.ptapp.infra.model.AppealInfo;
import com.woniuxy.ptapp.infra.AppealInfoDao;
import com.woniuxy.ptapp.infra.model.ClassesOrder;
import com.woniuxy.ptapp.service.AppealInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniuxy.ptapp.service.ClassesOrderService;
import com.woniuxy.ptapp.service.dto.AppealDto;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Queue;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wangdong
 * @since 2022-07-30
 */
@Service
public class AppealInfoServiceImpl extends ServiceImpl<AppealInfoDao, AppealInfo> implements AppealInfoService {

    @Resource
    ClassesOrderService classesOrderService;

    @Override
    public void startAppeal(AppealDto appealDto) {
        AppealInfo appealInfo = BeanCopyUtil.copyObject(appealDto, AppealInfo.class);
        boolean save = this.save(appealInfo);
        if(!save){
            throw new WoniuxyException(EnumExceptionCode.AppealSaveFail.getCode(),EnumExceptionCode.AppealSaveFail.getMessage());
        }
    }
}
